﻿using System;
using System.Security.Cryptography;

namespace cludg.Services.Security.Utils
{
	public class Password
	{
		public static string Generate()
		{
			var hasher = SHA256.Create();
			var random = new Random(Guid.NewGuid().GetHashCode());
			var hash = hasher.ComputeHash(Guid.NewGuid().ToByteArray());
			string s = Convert.ToBase64String(hash).Replace("=", "");
			s = s.Substring(random.Next(s.Length - 9), 8);
			return s;
		}
	}
}